#!/usr/bin/env python
# coding=utf-8
filename = 'alice.txt'

try:
    with open(filename) as f_obj:
        contents = f_obj.read()
except FileNotFoundError:
    print("{} is not exist!".format(filename))
else:
    # 计算文件大概包含多少个单词
    words = contents.split()
    print(words)
    num_words = len(words)
    print("The {} has about {} words.".format(filename, num_words))
